package com.coolwen.spring.jdbc.service;

import com.coolwen.spring.jdbc.dao.IGroupDao;
import com.coolwen.spring.jdbc.model.Group;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author CoolWen
 * @version 2020-04-16 10:19
 */
@Service
@Transactional(readOnly = true)
public class GroupSeviceImpl implements GroupSevice {

    @Autowired
    private IGroupDao groupDao;

    @Override
    @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
    public void add(Group group) {

    }

    @Override
    @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
    public void delete(int id) {

    }

    @Override
    @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
    public void update(Group group) {

    }

    @Override
    public Group load(int id) {
        return groupDao.load(id);
    }

    @Override
    public List<Group> list() {
        return null;
    }

    @Override
    public int loadCountGroup() {
        return 0;
    }
}
